import { Schema } from '@colyseus/schema';

interface IPlayerInfo {
    id: string;
    name: string;
    outfit: Array<string>;
    x: number;
    y: number;
    z: number;
    rx: number;
    ry: number;
    rz: number;
    sx: number;
    sy: number;
    sz: number;
    actionIndex: number;
    actionLoop: boolean;
    visible: boolean;
}

class MMOPlayer extends Schema {
    public id: string = '';
    public name: string = '';
    public outfit: Array<string> = [];
    public x: number = 0;
    public y: number = 0;
    public z: number = 0;
    public rx: number = 0;
    public ry: number = 0;
    public rz: number = 0;
    public sx: number = 1;
    public sy: number = 1;
    public sz: number = 1;
    public actionIndex: number = 0;
    public actionLoop: boolean = false;
    public visible: boolean = true;

    public infoObject(): IPlayerInfo {
        return {
            id: this.id,
            name: this.name,
            outfit: this.outfit,
            x: this.x,
            y: this.y,
            z: this.z,
            rx: this.rx,
            ry: this.ry,
            rz: this.rz,
            sx: this.sx,
            sy: this.sy,
            sz: this.sz,
            actionIndex: this.actionIndex,
            actionLoop: this.actionLoop,
            visible: this.visible,
        };
    }
}


export { MMOPlayer };
export type { IPlayerInfo };